-- GENERATED SPELL FOR [Shadowmoon Houndmaster] --


function spell0_23018(pUnit, Event) --@Freezing Trap,n/a--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(41085,pUnit:GetMainTank ())
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_23018', 1, 1)
end

function spell1_23018(pUnit, Event) --@Shoot,n/a--
pUnit:FullCastSpellOnTarget(41093,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23018', 590, 1)
end

function spell2_23018(pUnit, Event) --@Silencing Shot,n/a--
pUnit:FullCastSpellOnTarget(41084,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23018', 3320, 1)
end

function spell3_23018(pUnit, Event) --@Summon Riding Warhound,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(39906,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_23018', 1, 1)
end

function spell4_23018(pUnit, Event) --@Volley,n/a--
pUnit:FullCastSpellOnTarget(41091,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23018', 1000, 1)
end

function spell5_23018(pUnit, Event) --@Wing Clip,n/a--
pUnit:FullCastSpellOnTarget(32908,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23018', 10334, 1)
end

function Sorts_23018(pUnit, Event)
local choix_sorts_23018 = math.random(0, 5)
if choix_sorts_23018 == 0 then
pUnit:RegisterEvent('spell0_23018', 1, 1)
end
if choix_sorts_23018 == 1 then
pUnit:RegisterEvent('spell1_23018', 1, 1)
end
if choix_sorts_23018 == 2 then
pUnit:RegisterEvent('spell2_23018', 1, 1)
end
if choix_sorts_23018 == 3 then
pUnit:RegisterEvent('spell3_23018', 1, 1)
end
if choix_sorts_23018 == 4 then
pUnit:RegisterEvent('spell4_23018', 1, 1)
end
if choix_sorts_23018 == 5 then
pUnit:RegisterEvent('spell5_23018', 1, 1)
end
end

function mob23018_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_23018', math.random(1500, 3000), 1)
end

function mob23018_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob23018_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob23018_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(23018, 1, 'mob23018_Action')
RegisterUnitEvent(23018, 2, 'mob23018_Leave')
RegisterUnitEvent(23018, 3, 'mob23018_Kill')
RegisterUnitEvent(23018, 4, 'mob23018_Die')
